<!-- <style>
.index section table, .view table {
	color: #5a6d0c ;
}
.index section table tr:nth-child(odd), .form form .required input[type=text], .form form .required select, .view table tr:nth-child(odd) , .required input[type=file], .required textarea{
	background: #e8f0ca;
}
.index section table tr:nth-child(odd) {
	border-bottom: 1px solid #85a210;
	border-top: 1px solid #85a210;
}
.index section table tr.th_header, .view table tr th {
	border-color: #7d961d;
	background-color: #99b622;
}
header.topo, nav.menu_topo a, .index header, .index section p, .current, .filterForm .bt_search, .bt_clean, .submenu a, .form header, .form form input[type=submit], .form form button[type=reset], .form form fieldset legend, .error-message, .view header, .button input[type=button] {
	font-weight: bold;
}
header.topo p, .index header, .form header, .view header {
	line-height: 20px;
}
header.topo p:nth-child(2), header.topo p:nth-child(3), header.topo p:nth-child(4), header.topo p:last-child, .index header img, .form header img, .view header img {
	float: right;
}
nav.menu_topo a, .index section table tr td:last-child, .bt_clean, .form form, .form form .text, .form form .radio, .form form .select {
	text-align: center;
}
nav.menu_topo a, footer, .index section table tr.th_header th a, .filterForm .bt_search, .bt_clean, .submenu a, .form form input[type=submit], .form form button[type=reset], .view table tr th, .button input[type=button] {
	color: #fff;
}
#espacamento, .index header, .index section, .submenu, .filterForm, .form header, .tres_colunas form .textarea,  .duas_colunas form .textarea, .view header {
	overflow: auto !important;
}
.index, .form, .view {
	padding: 13px;
}
.index header, .index section, .paginacao, .filterForm input[type=text], .text span, .filterForm select, .index section table tr.th_header, .submenu a, .form header, .form form, .form form fieldset, .form form input[type=text], .form form select, .tres_colunas form textarea, .duas_colunas form textarea, .view header, .view table tr th, .view table tr td, .required input[type=file] {
	border: 1px solid;
}
.index header, .index section, .paginacao, .filterForm input[type=text],.text span, .filterForm select, .bt_clean, .filterForm .bt_search, .flash_bad, .flash_good, .flash_alert, .form header, .form form, .form form fieldset, .form form input[type=text], .form form input[type=submit], .form form button[type=reset], .form form select, .tres_colunas form textarea, .duas_colunas form textarea, .view header, .button input[type=button] , .required input[type=file] {
	border-radius: 5px;
	-moz-border-radius: 5px;
	-webkit-border-radius: 5px;
}
.index header, .index section table tr:nth-child(even), .form header, .form form select, .view header, .filterForm select {
	background-color: #fff;
}
.index header, .form header, .view header {
	font-size: 13px;
	margin-bottom: 15px;
    padding: 8px 9px 8px 14px;
}
.index section, .form form {
	padding: 10px;
	padding-bottom: 20px;
	min-height: 90px;
}
index section p {
	text-align: right;
	margin-bottom: 8px;
}
.index section table tr th, .view table tr th, .view table tr td {
	padding: 9px 12px;
}
.index section table tr td {
	padding: 8px 0 8px 12px;
}
.index section table tr td:last-child img {
	margin: 0 3px;
}
.index section table tr td:last-child, .form form fieldset legend {
	padding: 0 3px;
}
.index, .form, .view {
	padding: 13px;
}
.index section table th {
    color: #FFFFFF;
}
.index section table ul {
    color: #FFFFFF;
    text-align: center;
}
</style> -->
<script>
	function chamarAction(id){
		$("#inicial").empty();
		$('#inicial').load('confirmarEntrega/'+id);
	}
</script>
<div class="index">
	<?php //pr($entregas); 
		echo $this->Html->scriptBlock('
			$(document).ready(function() {
				$("#TblpessoafisicaCodigoCPF").setMask("cpf");
		  	});
		', array('inline' => true));
		if( $msg ) 
			echo '<script type="text/javascript">alert("'.$msg.'");</script>';
	?>
	<div class="titulo_pagina">
		<p> TELA DE ENTREGA </p>
	</div>
	<section>
		<?php 
			echo $this->element('paginator_total');
		    echo $filter->filterForm('Busca', array('update' => '#inicial'));
			//echo $this->Auxiliar->btnLimpar();
		?>
		<table>
			<?php 
				echo $this->Html->tableHeaders(
					array(
						'OS',
						'NOME CLIENTE',
						'CIDADE',
						'DATA/HORA',
						'STATUS',
					),
					array('class' => 'th_header')
				);
				foreach ( $entregas as $entrega) {
				  /*echo $this->Html->tableCells(
				      array(
				        array(
				          $entrega['Ordemservico']['id'],
				          $entrega['Ordemservico']['Pessoa']['nome'],
				          $entrega['Ordemservico']['Pessoa']['Municipio']['nome'],
				          $entrega['Entrega']['dataentrega'].' - '.$entrega['Entrega']['hora'],
				          $entrega['Status']['nome']
						 )
				      )
				   );*/
				  ?>
				<tr>
					<td onclick="chamarAction(<?php echo $entrega['Ordemservico']['id']; ?>)" style="cursor:pointer;">
						<?php echo $entrega['Ordemservico']['id']; ?>&nbsp;
					</td>
	  				<td onclick="chamarAction(<?php echo $entrega['Ordemservico']['id']; ?>)" style="cursor:pointer;">
						<?php echo $entrega['Ordemservico']['Pessoa']['nome']; ?>&nbsp;
					</td>
	  				<td onclick="chamarAction(<?php echo $entrega['Ordemservico']['id']; ?>)" style="cursor:pointer;">
						<?php echo $entrega['Ordemservico']['Pessoa']['Municipio']['nome']; ?>&nbsp;
					</td>
	  				<td onclick="chamarAction(<?php echo $entrega['Ordemservico']['id']; ?>)" style="cursor:pointer;">
						<?php echo $entrega['Entrega']['dataentrega'].' - '.$entrega['Entrega']['hora']; ?>&nbsp;
					</td>
	  				<td onclick="chamarAction(<?php echo $entrega['Ordemservico']['id']; ?>)" style="cursor:pointer;">
						<?php echo $entrega['Ordemservico']['Status'][0]['nome']; ?>&nbsp;
					</td>
				</tr>
  				<?php 
				}
			?>
		</table>
	</section>
	<?php 	
		echo $ajax->datepicker('EntregaDataentrega');
		echo $this->element('paginator'); 
	?>
</div>